import type * as Type from '@/api/processClient/processClient.d';

export interface PrHeaderState {
  currentId: number;
  queryToolList: QueryItem[];
  markToolList: MarkItem[];
}

export interface QueryItem {
  id: number;
  name: string;
  label: string;
  type: string | string[];
  isVisible?: boolean;
  toolType?: string;
}

export interface MarkItem extends QueryItem {
  lesionList: any[];
}

export interface LesionItem {
  id: number;
  name: string;
  lesion: string;
  color: string;
  eyeStatus: boolean;
  // toolType: string;
  signList: Sign[];
  lesionType?: number;
  firstMarkUserId?: number;
  secondMarkUserId?: number;
  positionVal?: number;
}

export interface Sign {
  formId: number | string;
  form: {
    [x: string]: string | string[]; 
  };
  formOptions: FormItem[];
  lesionType?: Number;
  firstMarkUserId?: Number;
  secondMarkUserId?: Number;
  positionVal?: Number;
}

export interface FormItem {
  id: number;
  name: string;
  type: string;
  // firstMarkUserName: string;
  lesionType: number;
  firstMarkUserId: number;
  firstMarkContent: string;
  // secondMarkUserName?: string;
  secondMarkUserId?: number;
  secondMarkContent?: string;
  approveField: string;
  approveContent: string;
  required: boolean;
  options?: OptionsItem[];
  parameter: {[x: string]: any};
}

export type OptionsItem = {
  label: string;
  value: string;
  children?: OptionsItem[];
}

export interface Lesion {
  id: number;
  isVisible: boolean;
  isAllVisible: boolean;
  lesionList: LesionListItem[][];
  viewList: {
    lesionData: LesionData;
    lesion: {
      signForm: Sign;
      compList: Component[];
    };
  }[];
}

export interface LesionListItem extends Type.AuditTaskImageResultList {
  isCurrent: boolean;
  isEye: boolean;
  className?: string;
  uuid: string;
  isApprove: boolean | null;
  name: string;
}

export interface SmallSign {
  formId: number;
  form: {
    [x: string]: string | string[]; 
  };
  formOptions: Component[];
}

export interface Component {
  id: number;
  name: string;
  type: string;
  lesionType?: number;
  required: boolean;
  options?: OptionsItem[];
  parameter: {[x: string]: any};
  result: string;
  formComponentId: number;
  auditTaskComponentResultId: number;
}

export interface ToolLesionItem {
  color: string;
  name: string;
}

export interface LesionData {
  firstLesionCode: string;
  firstLesionName: string;
  firstLesionId: number;
  firstMarkUserId: number;
  secondLesionCode: string;
  secondLesionName: string;
  secondLesionId: number;
  secondMarkUserId: number;
  approveLeisonCode: string;
  approveLeisonName: string;
  approveLeisonId: number;
  approveUserId: number;
  toolType: string;
  uuid: string;
  color: string;
  positionVal: number;
  lesionType: number;
  approveStatus: number;
  imageResult: any;
  className: string;
  isApproveEye: boolean;
  isCurrent: boolean;
  imageGroupId: number;
};

export interface DataList {
  series: string;
  sarIdList: number[];
  seriesCompList: Sign;
  children: Lesion[];
};